drop table bidefault.fsimage_info_csv;
CREATE EXTERNAL TABLE jms_ods.bgdm_fsimage_info_csv(
 path string, 
 replication string, 
 modificationtime string, 
 accesstime string, 
 preferredblocksize string, 
 blockscount string, 
 filesize string, 
 nsquota string, 
 dsquota string, 
 permission string, 
 username string, 
 groupname string)
COMMENT 'HDFS-fsimage文件'
PARTITIONED BY (
  `dt` string COMMENT '更新/创建日期 (yyyy-MM-dd)')
ROW FORMAT SERDE 
 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' 
WITH SERDEPROPERTIES ( 
 'field.delim'=',', 
 'serialization.format'=',') 
STORED AS INPUTFORMAT 
 'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
 '/dw/hive/jms_ods.db/external/bgdm_fsimage_info_csv';

CREATE EXTERNAL TABLE bidefault.fsimage_info_csv_cast(
 path string, 
 replication string, 
 modificationtime string, 
 accesstime string, 
 preferredblocksize string, 
 blockscount string, 
 filesize string, 
 nsquota string, 
 dsquota string, 
 permission string, 
 username string, 
 groupname string) COMMENT '' 
PARTITIONED BY (
  `dt` string COMMENT '更新/创建日期 (yyyy-MM-dd)')
STORED AS parquet
LOCATION
 '/dw/hive/bidefault.db/external/fsimage_info_csv_cast';